using NHibernate;
using System;
namespace AppToolKit.Data.NHibernate
{
	public class DataAccessObjectFactory : IDataAccessObjectFacotry
	{
		private IDbProcessor database_;
		private ISessionFactory sessionFactory_;
		public IDbProcessor Database
		{
			get
			{
				return this.database_;
			}
			set
			{
				this.database_ = value;
			}
		}
		public ISessionFactory SessionFactory
		{
			get
			{
				return this.sessionFactory_;
			}
			set
			{
				this.sessionFactory_ = value;
			}
		}
		public IDataAccessObject<T> Create<T>() where T : class
		{
			return new DefaultDataAccess<T>
			{
				NativeDatabase = this.Database,
				SessionFactory = this.sessionFactory_
			};
		}
	}
}
